<?php
namespace app\common\controller;

use think\Db;

class Upload
{

    /**
     * 图片上传
     **/
    public function uploadFile(){

        $filename = "pic";
        $upload_oss = false;
        if($upload_oss == true){

            $poster_url = $_FILES[$filename]["tmp_name"];
            $tempfilename = explode(".",$_FILES[$filename]["name"]);

            $reinfo = uploadimg($poster_url,end($tempfilename));

        }else{
            $reinfo = uploadimgToLocal($filename);
        }

        return json($reinfo);
    }


}